#ifndef _PM_MEM_ALLOCATION_
#define _PM_MEM_ALLOCATION_
#include <stdlib.h>
#define CACHE_SIZE 8192
#define LOOKUP_TABLE_SIZE 1025
#include "../headers/pyminer_boost.h"

struct MemoryCache
{
    int64_t stackptr;
    int64_t mem[CACHE_SIZE];
};

struct MemoryBlock
{
    int64_t size;
    void *ptr;
    struct MemoryBlock *next;
};

struct MemoryLinkedList
{
    int64_t length;
    struct MemoryBlock *first;
};

void mem_cache_init(struct MemoryCache *cache);
int64_t mem_cache_add(struct MemoryCache *cache, void *ptr);
void *mem_cache_get(struct MemoryCache *cache);

void *pm_malloc(int64_t size);

#endif